﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CodeGenerator.Core
{
    public class DBFactory
    {
        public static IDatabase Database(DatabaseType dbType)
        {
            switch (dbType)
            {
                case DatabaseType.SqlServer:
                    return new SqlServerDatabase();
                case DatabaseType.Sqlite:
                    return new SqliteDatabase();
                case DatabaseType.MySql:
                    return new MySqlDatabase();
                case DatabaseType.PostgreSQL:
                    return new PostgreSQLDatabase();
                default:
                    throw new Exception("不支持该数据库类型！");
            }
        }
    }
}
